/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.edu.kamai.xmlparser.speaking;

import com.edu.kamai.xml.beans.speaking.speakingAnswer;
import com.edu.kamai.xmlparser.answerGeneration;
import org.jdom.Document;
import org.jdom.Element;

/**
 *
 * @author xyzhu
 */
public class speakingAnswerGeneration extends answerGeneration{
    
    public speakingAnswerGeneration(speakingAnswer bean){
        sa = bean;
    }
    
    public void generateXML(){
        document = new Document();
        Element root = generateHead(sa.getPaperID(), sa.getUserID());
        
        for(int i=0;i<sa.getSpeakingMp3Path().size();i++){
            Element child = new Element("speakingAnswer");
            child.addContent(new Element("speakingMp3Path").setText(sa.getSpeakingMp3Path().get(i)));
            root.addContent(child);
        }
        document.setContent(root);
    }
    
    private speakingAnswer sa;
    
}
